inline HTML images using PEAR"s mail_mime?
am 29.11.2007 17:33:03 von Law PoopHello all --
I'm having a problem getting images to appear in the body of an HTML
email using PEAR's mail_mime class.
Here's my code, what am I doing wrong?
include("Mail.php");
include("./Mail/mime.php");
$text = "Text version of email";
$html = "
This is a test of
html capabilities within the body of
the email.
$file = "./images/logo.jpg";
$crlf = "\n";
$hdrs = array(
"From" => "lawpoop@gmail.com",
"Subject" => "Test message"
);
$mime = new Mail_mime($crlf);
$mime -> setTXTBody($text);
$mime -> addHTMLImage("./images/logo.jpg");
$mime -> setHTMLBody($html);
$mime -> addAttachment( $file, "image/jpeg" );
$body = $mime->get();
$hdrs = $mime->headers($hdrs);
$mail =& Mail::factory("mail");
$mail -> send("lawpoop@gmail.com", $hdrs, $body);
echo "
Message sent!
";